﻿using AlarmModule.Models;
using Prism.Commands;
using Prism.Dialogs;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MonitorModule.ViewModels {
    public class SettingsViewModel : BindableBase, IDialogAware {
        public SettingsViewModel() {
            DeleteCommand = new DelegateCommand(Delete);
        }

        private void Delete() {
            
        }

        public DelegateCommand DeleteCommand { set; get; }

        public DialogCloseListener RequestClose {  get; set; }

        public bool CanCloseDialog() {
            return true;
        }

        public void OnDialogClosed() {
            
        }
        public string Title { get; set; } = " ";
        public void OnDialogOpened(IDialogParameters parameters) {
            Title = parameters.GetValue<string>("Title");
            _EnviromentList = parameters.GetValue<ObservableCollection<AlarmParameter>>("EnviromentList");
            _DeviceList = parameters.GetValue<ObservableCollection<AlarmParameter>>("DeviceList");
        }
        /// <summary>
        /// 环境监控数据
        /// </summary>
        private ObservableCollection<AlarmParameter> _EnviromentList;

        /// <summary>
        /// 环境监控数据
        /// </summary>
        public ObservableCollection<AlarmParameter> EnviromentList {
            get { return _EnviromentList; }
            set {
                _EnviromentList = value;
                RaisePropertyChanged();
            }
        }
        /// <summary>
        /// 设备集合
        /// </summary>
        private ObservableCollection<AlarmParameter> _DeviceList;

        /// <summary>
        /// 设备集合
        /// </summary>
        public ObservableCollection<AlarmParameter> DeviceList {
            get { return _DeviceList; }
            set {
                _DeviceList = value;
                RaisePropertyChanged();
            }
        }
    }
}
